function update(){
	var url = BASE_PATH + '/commonController/toHeaderAndFooter';
	window.location.href = url;
}

function returnView(){
	var url = BASE_PATH + '/commonController/toHeaderAndFooter';
	window.location.href = url;
}		
		
function save(flag){
	$.plugin.plugLoading("正在提交，请稍后...");
	var headerValue =  $("#header").val();
	var footervalue =  $("#footer").val();
	 
	
	var formParams = {header:headerValue,footer:footervalue};
	var viewType=flag;

    var url=BASE_PATH +"/commonController/save";
    $.ajax({
		type :"POST",
		url: url,
		dataType:'json',
		data:formParams,
		success: function(result) {
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:"保存成功",
					timeout:2000,
					showType:'slide' 
				});
				setTimeout(function(){
					$.plugin.close();
					$.plugin.plugLoading("正在跳转，请稍后...");
					window.location.href = BASE_PATH+'/commonController/viewHeaderAndFooter';
					
				},2000)	
			}else{
				$.plugin.close();
				$.messager.alert("系统提示","保存失败！","error");
			}
		},
		error:function(){
			$.plugin.close();
			$.messager.alert("系统提示","系统错误！","error");
		}
	});
}

 